package com.ypx.ec.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ypx.ec.common.to.mq.OrderTo;
import com.ypx.ec.common.to.mq.StockLockedTo;
import com.ypx.ec.common.utils.PageUtils;
import com.ypx.ec.ware.entity.WareSkuEntity;
import com.ypx.ec.ware.vo.SkuHasStockVo;
import com.ypx.ec.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author yepinxi
 * @email 1554039596@qq.com
 * @date 2022-03-10 17:03:50
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addSku(Long skuId,Long wareId,Integer stock);

    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockVo vo);

    void unlockStock(StockLockedTo to);

    /**
     * 主动解锁库存
     * @param orderDTO
     */
    void unlockStock(OrderTo orderDTO);
}

